package com.karst.essentials.chapter10
{
	import org.papervision3d.core.geom.Particles;
	import org.papervision3d.core.geom.renderables.Particle;
	import org.papervision3d.materials.special.ParticleMaterial;

	internal class ParticleMaterialExample extends ParticleTemplate
	{
		public function ParticleMaterialExample()
		{
			super();
		}
		
		override protected function createView():void
		{
			super.createView() ;
			
			for( var i : int = 0 ; i < numOfPartices; i++)
			{
				var particleMaterial : ParticleMaterial = new ParticleMaterial(
					Math.random()*0xFFFFFF, 1, ParticleMaterial.SHAPE_CIRCLE ) ;
				var particle : Particle = new Particle( particleMaterial, Math.random()*5 + 5,
					randPos(), randPos(), randPos() ) ;
				particles.addParticle( particle ) ;
			}
		}
	}
}